package com.six.remark.controller.api;

import com.six.core.entity.Remark;
import com.six.core.vo.Result;
import com.six.remark.service.RemarkService;
import com.six.remark.vo.SearchRemark;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName:RemarkApiController
 * Description:
 * date:2023/3/10 16:09
 *
 * @since JDK 1.8
 */
@RestController
@RequestMapping("remark/api/remark")
public class RemarkApiController {
    @Autowired
    private RemarkService remarkService;
    @PostMapping("findAll")
    public Result findAll(String id,@RequestParam(defaultValue = "1") Integer currentPage, @RequestParam(defaultValue = "5")Integer pageSize){
        return remarkService.findAllRemark(id,currentPage,pageSize);
    }
    @PostMapping("findmyRemark")
    public Result findmyRemark(String goodsid,@RequestParam(defaultValue = "1") Integer currentPage, @RequestParam(defaultValue = "5")Integer pageSize){
        return remarkService.findMyRemark(goodsid,currentPage,pageSize);
    }
    @PostMapping("updateRemark")
    public Result updateRemark(@RequestBody Remark remark){
        return remarkService.update(remark);
    }
    @GetMapping("deleteById")
    public Result deleteById(Integer id){
        return remarkService.deleteById(id);
    }
}
